package practice;

import java.util.Scanner;

public class _俄罗斯方块_ {
    public static void main(String[] args) {
        _俄罗斯方块_ c = new _俄罗斯方块_();
        _俄罗斯方块_.Solution s = c.getSolution();
        System.out.println(s.Main());
    }

    Solution getSolution() {
        return new Solution();
    }

    class Solution {
        public int Main() {
            Scanner sc = new Scanner(System.in);
            String line1 = sc.nextLine();
            String line2 = sc.nextLine();
            String[] arr1 = line1.split(" ");
            int n = Integer.valueOf(arr1[0]);
            int m = Integer.valueOf(arr1[1]);
            String[] arr2 = line2.split(" ");
            int[] numarr = new int[m];
            for (int i = 0; i < m; i++) {
                numarr[i] = Integer.valueOf(arr2[i]);
            }

//            return 1;
            int[] recourd = new int[n];
            for (int i = 0; i < m; i++) {
                recourd[numarr[i]-1] += 1;
            }
            int score = recourd[0];
            for (int i = 0; i < recourd.length; i++) {
                if (recourd[i] < score) score = recourd[i];
            }
            return score;
        }
    }
}
